I'm trying to create a view whch only lists nodes in the language they were first created, for instance if someone creates a node in english and then it is translated to spanish and other languages, i just want in the list the english version, not the further translated ones, the same goes if the first node is in another language, it doesn't matter, i want to list only the "original" ones, not the translations... i guess this is done with the "Node translation: Translation set node ID" filter, but it doesn't work!... after adding it I get this:

Error: handler for node > tnid doesn't exist!

The closest issue I found was this: http://drupal.org/node/315643, but it's not exactly the same issue, but i guess it would be a similar fix. I'd apretiate some help, thanks in advance

CommentFileSizeAuthor
#8 views-filter-tnid.patch3.29 KBnedjo

Comments

dergachev’s picture

I'm having the same problem. Will investigate.

dergachev’s picture

Not tested yet, but in your linked issue there's a comment giving a solution for this very problem. http://drupal.org/node/315643#comment-1044353

to get "Node translation: Translation set node ID" running, it might be useful to change the filter-handler on line 56 in translation.views.inc from views_handler_filter_node_tnid to views_handler_filter_numeric

The file in question is in sites/all/views/modules/translation.views.inc

leanazulyoro’s picture

yes i tested that with no success...

dergachev’s picture

Seems to work for me.

leanazulyoro’s picture

Status: Active » Fixed

yes, it does work, I just forgot to clear cache after modifing translations.views.inc. nevertheless I discovered this filter is not what need, I'll create a new issue for that, please include this modification in the next version: http://drupal.org/node/315643#comment-1044353

xano’s picture

Status: Fixed » Active

I can confirm the bug is still there in 6.x-2.1. Since no fix has been committed, this issue cannot be marked 'fixed'.

//Edit: I can't get the fix to work. I edited lines 56 and 59 (replaced tnid handler by numeric handler) and cleared all caches. I am still getting the original error.

nedjo’s picture

Assigned: Unassigned » nedjo

Looks like I left this filter out of the patch that added translation support.

I'll work up the filter.

nedjo’s picture

Status: Active » Needs review
StatusFileSize
new3.29 KB

Here's a patch that does two things:

1. Use the default numeric filter for node.tnid. This is parallel to node.nid. This part of the patch is a pure bugfix.

2. Add a filter for node source translation (what leanazulyoro was looking for).

This new filter is configurable to select whether only source translations should be shown (nodes with the same tnid as nid) or if untranslated nodes should also be shown (nodes with tnid = 0).

This part of the patch is the functionality that I think I had in mind originally but didn't complete.

We also need to remove the unsued views_handler_field_node_tnid. I'll open a separate issue for that.

xano’s picture

Can the filter also select only one translation per translation group, ordering the translations within a group by several conditions? Example: I'd like to show one translation per group, preferably in the current user's language, but in English if there is no translation in that specific language available.

leanazulyoro’s picture

great, I'll give it a try, but I have already found a solution for that: http://drupal.org/project/select_translation, I havent tried your patch yet nedjo, but this may be what Xano wants in #9

thanx!! i'll try it and report if everything work well

this is the issue i created for what I hwas needing: http://drupal.org/node/338503

leanazulyoro’s picture

all right... it works like a charm nedjo, anyway, you may want to consider some of the functionality in the "select translation" module (http://drupal.org/project/select_translation). thanks for everything =)

merlinofchaos’s picture

Status: Needs review » Fixed

Thanks nedjo! Committed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Funkwarrior’s picture

Sorry, I need some additionals infos how to accomplish that... somebody can help me? :)

Funkwarrior’s picture

Well, I found the solution: not difficult but for a novice is not simply clear :).

If somebody needs same solution:

To get the translated Fields from a single Nid:

On Filter pane of your view:

Node translation: Translation set node ID = 62
Node translation: Language = Current user's language

That's it.